<%--
  Created by IntelliJ IDEA.
  User: 王志斌
  Date: 2019/2/5
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath();%>

<!-- 根据岗位类别搜索 -->
<c:if test="${!empty requestScope.postList}">
    <div class="col-12 table-responsive" id="infoDiv">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>岗位名称</th>
                <th>部门名称</th>
                <th>类别</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.postList}" var="list">
                <tr>
                    <td>${list.postType}</td>
                    <td>${list.department.departmentName}</td>
                    <td>${list.postTypeId.name}</td>
                    <td class="td-manage">
                        <a title="编辑" onclick="updatePost(${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                        <a title="删除" onclick="member_del(this,${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</c:if>

<c:if test="${empty requestScope.postList and requestScope.type ne 'departMentType' and requestScope.type ne 'pager'}">
    <p style="color:blue;">此类别无内容</p>
</c:if>

<!-- 根据部门搜索 -->
<c:if test="${requestScope.type eq 'departMentType'}">
    <div class="col-12 table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>岗位名称</th>
                <th>部门名称</th>
                <th>类别</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.postInfoByDepartId}" var="list">
                <tr>
                    <td>${list.postType}</td>
                    <td>${list.department.departmentName}</td>
                    <td>${list.postTypeId.name}</td>
                    <td class="td-manage">
                        <a title="编辑" onclick="updatePost(${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                        <a title="删除" onclick="member_del(this,${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</c:if>

<!-- 显示分页 -->
<c:if test="${requestScope.type eq 'pager'}">
    <div class="col-12 table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>岗位名称</th>
                <th>部门名称</th>
                <th>类别</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.postListPage}" var="list">
                <tr>
                    <td>${list.postType}</td>
                    <td>${list.department.departmentName}</td>
                    <td>${list.postTypeId.name}</td>
                    <td class="td-manage">
                        <a title="编辑" onclick="updatePost(${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                        <a title="删除" onclick="member_del(this,${list.id})" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</c:if>




